#include<stdio.h>
#include"SList.h"

static void print(SLTNode* head)
{
	head = head->next;
	while (head)
	{
		printf("%d->", head->data);
		head = head->next;
	}
	printf("NULL\n");
}


void test1()
{
	SLTDataType ret = 0;
	SLTNode* plist1 = SLTInit();
	SLTPushFront(plist1, 1); print(plist1);
	SLTPushFront(plist1, 2); print(plist1);
	SLTPushFront(plist1, 3); print(plist1);
	SLTPushFront(plist1, 4); print(plist1);
	SLTPushBack(plist1, 111); print(plist1);
	SLTPushBack(plist1, 112); print(plist1); 
	ret = SLTPopBack(plist1); print(plist1); printf("return = %d\n", ret);
	ret = SLTPopBack(plist1); print(plist1); printf("return = %d\n", ret);
	ret = SLTPopBack(plist1); print(plist1); printf("return = %d\n", ret);

	ret = SLTPopFront(plist1); print(plist1); printf("return = %d\n", ret);
	ret = SLTPopFront(plist1); print(plist1); printf("return = %d\n", ret);
	ret = SLTPopFront(plist1); print(plist1); printf("return = %d\n", ret);
}

int main()
{
	test1();

	return 0;
}